-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: add comprehensive end-to-end tests for connection gating #2200
Conversation
d4872ec
to
03a37d3
Compare
ab67003
to
eccdae1
Compare
What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right? |
1 similar comment
What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right? |
p2p/test/transport/gating_test.go
Outdated
require.Equal(t, stripCertHash(h2.Addrs()[0]).String(), addrs.RemoteMultiaddr().String()) | ||
}), | ||
) | ||
require.Error(t, h1.Connect(ctx, peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What error are we expecting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on the transport. All we can assert here is that some kind of error occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do better? Should we return a well known error? Callers may want to check if this error case happened and it doesn’t make sense for them to check against all error types depending on underlying transport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but that would require changing all the transports.
p2p/test/transport/gating_test.go
Outdated
require.Error(t, h1.Connect(ctx, peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()})) | ||
// There's a bug in the WebSocket library, making Close block for up to 5s. | ||
// See https://github.com/nhooyr/websocket/issues/355 for details. | ||
if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above here.
Was reviewing as you wrote that! |
eccdae1
to
7bb03ef
Compare
7bb03ef
to
1e2f471
Compare
f30bd71
to
e03d8fa
Compare
e03d8fa
to
4c3a890
Compare
4c3a890
to
e4c09d4
Compare
No description provided.